import urllib.request
name = input("歌曲名称：")
url = 'http://music.163.com/song/media/outer/url?id=287749'
try:
    urllib.request.urlretrieve(url,'%s.mp3'%name)
    print("下载成功")
except:
    print("下载失败")